import request from '@/config/axios'

export interface ProjectVO {
  id: number
  pics: string
  company: string
  province: string
  city: string
  area: string
  address: string
  lon: string
  lat: string
  startTime: Date
  endTime: Date
  userId: number
  financeId: number
  orderNumber: number
}

// 查询项目管理列表
export const getProjectPage = async (params) => {
  return await request.get({ url: `/system/project/page`, params })
}

// 查询项目管理详情
export const getProject = async (id: number) => {
  return await request.get({ url: `/system/project/get?id=` + id })
}

// 新增项目管理
export const createProject = async (data: ProjectVO) => {
  return await request.post({ url: `/system/project/create`, data })
}

// 修改项目管理
export const updateProject = async (data: ProjectVO) => {
  return await request.put({ url: `/system/project/update`, data })
}

// 删除项目管理
export const deleteProject = async (id: number) => {
  return await request.delete({ url: `/system/project/delete?id=` + id })
}

// 导出项目管理 Excel
export const exportProject = async (params) => {
  return await request.download({ url: `/system/project/export-excel`, params })
}
